import java.util.Arrays;

public class Test {
    public static void temp(int[]array){
        for (int i = 0; i < array.length ; i++) {
            for (int j = array.length-1; j >0; j--) {
                if(i%2!=0&&j%2==0&&i<j){
                    int tem=array[j];
                    array[j]=array[i];
                    array[i]=tem;
                }
            }
        }
    }
    public static void main(String[] args) {
    int[] array={1,2,3,4,5,6};
    temp(array);
        System.out.println(Arrays.toString(array));
    }
}

